//
//  UIViewController+App.h
//  ZZmetro
//
//  Created by 一介布衣 on 2020/6/5.
//  Copyright © 2020 一介布衣. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    VIEW_DATA_LOAD_STATE_NONE,
    VIEW_DATA_LOAD_STATE_LOADING,
    VIEW_DATA_LOAD_STATE_SUCCESS,
    VIEW_DATA_LOAD_STATE_FAILED,
    VIEW_DATA_LOAD_STATE_NODATA
} VIEW_DATA_LOAD_STATE;

typedef NS_ENUM(NSUInteger, NAV_BAR_STYLE)
{
    NAV_BAR_STYLE_1,
    NAV_BAR_STYLE_2,
    NAV_BAR_STYLE_3
};

@interface UIViewController (App) <UIGestureRecognizerDelegate>

/**
 设置导航样式

 @param style 样式
 */
+ (void)setNavigationBarWithStyle:(NAV_BAR_STYLE)style;

/**
 *  自定义返回按钮
 */
- (void)initWithBackButton;
- (void)initWithBackButton:(NSString *)iconName;
- (void)mandatoryWithBackButton:(NSString *)iconName;

/**
 *  自定义右边按钮
 */
- (void)initWithRightButton:(NSString *)name buttonWidth:(CGFloat)buttonWidth selector:(SEL)selector;

/**
 *  返回上一级
 */
- (void)popController;

/**
 *  添加数据异常时，页面的展示
 */
- (void)addExceptionViewWithSelector:(SEL)selector state:(VIEW_DATA_LOAD_STATE)state;
- (void)addExceptionViewWithSelector:(SEL)selector state:(VIEW_DATA_LOAD_STATE)state tipString:(NSString *)tipString;

/**
 *  从导航控制器中移除当前页面
 */
- (void)closeCurrentViewController;

/**
 获取顶层视图

 @return 视图
 */
- (UIViewController *)topViewController;
@end

NS_ASSUME_NONNULL_END
